"""
@author: Tim Lux
@license: AGPL
"""

from . import sel
from . import finn
#imports for using without django
# import sel
# import finn

def getStockQuotes(dict_stocks):
    """operates firefox and stock-tabs, returns quotes
    
    Keyword arguments:
        dict_stocks -- dict_stockstionary {"SYML": {"amout":1, "value": 0}}
    
    return:
        dict_stockstionary {"SYML": {"amount":2, "value": 100, "total_value":200}, "_all": 200}
            last key "_all" -->  total value of all stocks        
    """
    return sel.getStockQuotes(dict_stocks)

def quitGecko():
    """close firefox+gecko and all tabs"""
    return sel.quitGecko()

def getQuote(symbol):
    """Returns current stock price in USD, called by stock-symbol"""
    return finn.getQuote(symbol)

def getAllUsStocks():
    """get dictionary of all US stocks by finnhub"""
    return finn.getAll()
